﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Show1
{
    public partial class FrmMain : Form
    {

        /// <summary>
        /// 当前登录的用户名
        /// </summary>
        public string loginName;

        public FrmMain()
        {
            InitializeComponent();
        }

        private void FrmMain_Load(object sender, EventArgs e)
        {
            this.Text += "【当前登录："+this.loginName+"】";
        }

        private void toolStripMenuItem2_Click(object sender, EventArgs e)
        {

        }

        private void tsmiExit_Click(object sender, EventArgs e)
        {
           DialogResult dr =  MessageBox.Show("确定要退出整个程序吗？","退出确认",MessageBoxButtons.OKCancel,MessageBoxIcon.Question);
           if (dr == System.Windows.Forms.DialogResult.OK)
           {
               //退出所有程序（包括所有的隐藏窗口）
               Application.Exit();
           }
            
        }

        private void tsmiAddStu_Click(object sender, EventArgs e)
        {
            FrmAdd frm = new FrmAdd();//新建一个添加窗体
            frm.MdiParent = this;//把添加窗体的父容器设置成当前
            frm.Show();
        }
    }
}
